package com.xiaotao.mq.mq;


import com.xiaotao.mq.config.DelayedMessageConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 死信队列消费者
 * @author Qiang
 * @date 2024/01/27
 */
@Component
@Slf4j
public class DlxConsumer {

    /**
     * 订单超时取消
     */
    @RabbitListener(queues = DelayedMessageConfig.DELAYED_QUEUE_NAME)
    public void handle(Message message) {
        String msg = new String(message.getBody());
        System.out.println(msg);
    }
}
